package cn.sirun.com.fca.account.loader;

import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.base.SubmitPhoneRequest;
import cn.sirun.com.fca.account.model.base.SubmitPhoneResponse;
import cn.sirun.com.fca.account.model.register.SubmitEmailRequest;
import cn.sirun.com.fca.account.repo.register.RegisterRepository;
import cn.sirun.com.fca.account.repo.reset.ResetRepository;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;

public class PhoneLoader extends AccountFlowLoader {

    public Observable<BaseResponse<SubmitPhoneResponse>> submitPhone(SubmitPhoneRequest request) {
        return RegisterRepository.getInstance().submitPhone(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> submitEmail(SubmitEmailRequest request) {
        return RegisterRepository.getInstance().submitEmail(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> resetSubmitPhone(SubmitPhoneRequest request) {
        return ResetRepository.getInstance().submitPhone(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SubmitPhoneResponse>> resetSubmitEmail(SubmitEmailRequest request) {
        return ResetRepository.getInstance().submitEmail(request)
                .subscribeOn(Schedulers.io());
    }
}
